bitkeeper revision 1.1159.17.5 (4119385aTLA7Shj5_vrBcoAQ3-zimg)
authorkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>
Tue, 10 Aug 2004 21:04:26 +0000 (21:04 +0000)
committerkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>
Tue, 10 Aug 2004 21:04:26 +0000 (21:04 +0000)
Cset exclude: gm281@boulderdash.cl.cam.ac.uk|ChangeSet|20040810153437|54233

19 files changed:
tools/examples/xmdefaults
tools/examples/xmexample
tools/libxc/xc.h
tools/libxc/xc_domain.c
tools/python/xen/lowlevel/xc/xc.c
tools/python/xen/xend/XendDomainInfo.py
tools/python/xen/xm/create.py
xen/arch/x86/smpboot.c
xen/common/dom0_ops.c
xen/common/domain.c
xen/common/kernel.c
xen/common/sched_atropos.c
xen/common/sched_bvt.c
xen/common/sched_fair_bvt.c
xen/common/sched_rrobin.c
xen/common/schedule.c
xen/include/hypervisor-ifs/dom0_ops.h
xen/include/xen/sched-if.h
xen/include/xen/sched.h

index 0c1f52b69d8b0dc232ed5194a37017e7ded7082f..0b7c5b2230543dea5792193cf182466b0614185e 100644 (file)
@@ -25,10 +25,6 @@ name = "ExampleDomain"
 
 # Which CPU to start domain on? 
 #cpu = -1   # leave to Xen to pick
-# The weight (CPU share) of the domain. Works with all
-# schedulers that have notion of weight (eg BVT). 
-# Default is 1. Float values can be used.
-#weight = 1.5
 
 #----------------------------------------------------------------------------
 # Define network interfaces.
index b8717fb29a06effd32e3fa40536756af2ea24569..d6df731c451d026e929977ad19e7dd57eb57415c 100644 (file)
@@ -55,10 +55,6 @@ name = "VM%d" % vmid
 # Which CPU to start domain on? 
 #cpu = -1   # leave to Xen to pick
 cpu = vmid  # set based on vmid (mod number of CPUs)
-# The weight (CPU share) of the domain. Works with all
-# schedulers that have notion of weight (eg BVT). 
-# Default is 1. Float values can be used.
-#weight = 1.5
 
 #----------------------------------------------------------------------------
 # Define network interfaces.
index d44c1942f50cb8889ad599f37a7f4fb0e798a832..b2cf0c67ba4826a38d11843f777b1f164c16000e 100644 (file)
@@ -48,7 +48,6 @@ int xc_domain_create(int xc_handle,
                      unsigned int mem_kb, 
                      const char *name,
                      int cpu,
-                     float weight,
                      u32 *pdomid);
 int xc_domain_pause(int xc_handle, 
                     u32 domid);
index 41bff1fe5f3dad6f81fe0c077a11fd3cb39ba5b4..10017c74fe7cb6a415e0dcab62d6050510b1a1cf 100644 (file)
@@ -12,7 +12,6 @@ int xc_domain_create(int xc_handle,
                      unsigned int mem_kb, 
                      const char *name,
                      int cpu,
-                     float weight,
                      u32 *pdomid)
 {
     int err;
@@ -21,8 +20,6 @@ int xc_domain_create(int xc_handle,
     op.cmd = DOM0_CREATEDOMAIN;
     op.u.createdomain.domain = (domid_t)*pdomid;
     op.u.createdomain.memory_kb = mem_kb;
-    /* The weight of a domain added to the domain creation code */
-    op.u.createdomain.weight = weight;
     strncpy(op.u.createdomain.name, name, MAX_DOMAIN_NAME);
     op.u.createdomain.name[MAX_DOMAIN_NAME-1] = '\0';
     op.u.createdomain.cpu = cpu;
index d2a12026efe253900f9e486c4da170f39ad37852..4b5a426b55ff480f44cc19a81b408758fa6c0b3c 100644 (file)
@@ -44,19 +44,16 @@ static PyObject *pyxc_domain_create(PyObject *self,
     unsigned int mem_kb = 0;
     char        *name   = "(anon)";
     int          cpu = -1;
-    float        weight;
     u32          dom = 0;
     int          ret;
 
-    static char *kwd_list[] = { "dom", "mem_kb", "name", "cpu", "weight",
-                                                                        NULL };
+    static char *kwd_list[] = { "dom", "mem_kb", "name", "cpu", NULL };
 
-    if ( !PyArg_ParseTupleAndKeywords(args, kwds, "|iisif", kwd_list, 
-                                      &dom, &mem_kb, &name, &cpu, &weight) )
+    if ( !PyArg_ParseTupleAndKeywords(args, kwds, "|iisi", kwd_list, 
+                                      &dom, &mem_kb, &name, &cpu) )
         return NULL;
-        
-    if ( (ret = xc_domain_create(xc->xc_handle, mem_kb, name, cpu, 
-                                                     weight, &dom)) < 0 )
+
+    if ( (ret = xc_domain_create(xc->xc_handle, mem_kb, name, cpu, &dom)) < 0 )
         return PyErr_SetFromErrno(xc_error);
 
     return PyInt_FromLong(dom);
index 6032f6919df73455c83df069f308df92efdc0e45..0df3c2208ae06c915420cdac75356d3bd94180f2 100644 (file)
@@ -486,7 +486,6 @@ class XendDomainInfo:
         self.config = config
         try:
             self.name = sxp.child_value(config, 'name')
-            self.weight = float(sxp.child_value(config, 'weight'))
             self.check_name(self.name)
             self.memory = int(sxp.child_value(config, 'memory'))
             if self.memory is None:
@@ -706,10 +705,9 @@ class XendDomainInfo:
             return
         memory = self.memory
         name = self.name
-        weight = self.weight
         cpu = int(sxp.child_value(self.config, 'cpu', '-1'))
         dom = self.dom or 0
-        dom = xc.domain_create(dom= dom, mem_kb= memory * 1024, name= name, cpu= cpu, weight= weight)
+        dom = xc.domain_create(dom= dom, mem_kb= memory * 1024, name= name, cpu= cpu)
         if dom <= 0:
             raise VmError('Creating domain failed: name=%s memory=%d'
                           % (name, memory))
@@ -1139,7 +1137,6 @@ add_device_handler('pci',  vm_dev_pci)
 add_config_handler('name',    vm_field_ignore)
 add_config_handler('memory',  vm_field_ignore)
 add_config_handler('cpu',     vm_field_ignore)
-add_config_handler('weight',  vm_field_ignore)
 add_config_handler('console', vm_field_ignore)
 add_config_handler('image',   vm_field_ignore)
 add_config_handler('device',  vm_field_ignore)
index f28f20384984967faa9126a3f5f08b94c157b011..286e1d34787c5abda6c057225c301231f74aa02b 100644 (file)
@@ -97,10 +97,6 @@ gopts.var('memory', val='MEMORY',
           fn=set_value, default=128,
           use="Domain memory in MB.")
 
-gopts.var('weight', val='WEIGHT',
-          fn=set_value, default=1,
-          use="Domain cpu weight (default=1).")
-
 gopts.var('console', val='PORT',
           fn=set_int, default=None,
           use="Console port to use. Default is 9600 + domain id.")
@@ -299,8 +295,7 @@ def make_config(vals):
     
     config = ['vm',
               ['name', vals.name ],
-              ['memory', vals.memory ],
-              ['weight', vals.weight] ]
+              ['memory', vals.memory ] ]
     if vals.cpu:
         config.append(['cpu', vals.cpu])
     if vals.blkif:
index da4130f34e3a8b3d607f9a674473c324fc57289d..bd9c0951ec760b50f9da1a3f275d3fdf4df93bbc 100644 (file)
@@ -650,7 +650,7 @@ static void __init do_boot_cpu (int apicid)
 
     cpu = ++cpucount;
 
-    if ( (idle = do_createdomain(IDLE_DOMAIN_ID, cpu, 0)) == NULL )
+    if ( (idle = do_createdomain(IDLE_DOMAIN_ID, cpu)) == NULL )
         panic("failed 'createdomain' for CPU %d", cpu);
 
     set_bit(DF_IDLETASK, &idle->flags);
index e31d0a6025c930d62bf4fd20b65f048440b1f76d..0a4086ef6e06de8206bbfde9a8d70208076a290e 100644 (file)
@@ -182,9 +182,9 @@ long do_dom0_op(dom0_op_t *u_dom0_op)
             pro = op->u.createdomain.cpu % smp_num_cpus;
 
         ret = -ENOMEM;
-        if ( (d = do_createdomain(dom, pro, op->u.createdomain.weight))==NULL)
+        if ( (d = do_createdomain(dom, pro)) == NULL )
             break;
-        
+
         if ( op->u.createdomain.name[0] )
         {
             strncpy(d->name, op->u.createdomain.name, MAX_DOMAIN_NAME);
index 3f3f876111e7e13ee65c8635d5360962101bc2e2..cac4c2edf07d15d34bf830a9d63b75525a1d613b 100644 (file)
@@ -22,7 +22,7 @@ rwlock_t tasklist_lock __cacheline_aligned = RW_LOCK_UNLOCKED;
 struct domain *task_hash[TASK_HASH_SIZE];
 struct domain *task_list;
 
-struct domain *do_createdomain(domid_t dom_id, unsigned int cpu, float weight)
+struct domain *do_createdomain(domid_t dom_id, unsigned int cpu)
 {
     char buf[100];
     struct domain *d, **pd;
@@ -69,7 +69,7 @@ struct domain *do_createdomain(domid_t dom_id, unsigned int cpu, float weight)
         spin_lock_init(&d->pcidev_lock);
         INIT_LIST_HEAD(&d->pcidev_list);
 
-        sched_add_domain(d, weight);
+        sched_add_domain(d);
 
         write_lock_irqsave(&tasklist_lock, flags);
         pd = &task_list; /* NB. task_list is maintained in order of dom_id. */
@@ -85,7 +85,7 @@ struct domain *do_createdomain(domid_t dom_id, unsigned int cpu, float weight)
     else
     {
         sprintf(d->name, "Idle-%d", cpu);
-        sched_add_domain(d, weight);
+        sched_add_domain(d);
     }
 
     return d;
index 0e0b240b79c91afbb5e6ad1c21560fb97ebab010..6a39946d700d276f7a6a574c942bd483f0a23b6e 100644 (file)
@@ -306,7 +306,7 @@ void cmain(multiboot_info_t *mbi)
     task_hash[TASK_HASH(IDLE_DOMAIN_ID)] = &idle0_task;
 
     /* Create initial domain 0. */
-    new_dom = do_createdomain(0, 0, 1);
+    new_dom = do_createdomain(0, 0);
     if ( new_dom == NULL )
         panic("Error creating domain 0\n");
 
index b93ea89dd9e8d07a591f76a8f55fe83dcde98311..53e4519b9fa2728a417667eb3ddeb0b4c1acb56d 100644 (file)
@@ -167,10 +167,8 @@ static void requeue(struct domain *sdom)
      * - they shouldn't be on any queue */
 }
 
-/* prepare a task to be added to scheduling 
-    TODO - can weight argument can be used to set up the 
-    scheduling parameters? */
-static void at_add_task(struct domain *p, float weight)
+/* prepare a task to be added to scheduling */
+static void at_add_task(struct domain *p)
 {
     s_time_t now = NOW();
 
index 25e71f0e4d4bdd091e5554b0241ba6ef0ae63cde..e4ee214b543ab40030ca4c7581e804dac8fc51b8 100644 (file)
@@ -180,16 +180,13 @@ int bvt_alloc_task(struct domain *p)
 /*
  * Add and remove a domain
  */
-void bvt_add_task(struct domain *p, float weight
+void bvt_add_task(struct domain *p) 
 {
     struct bvt_dom_info *inf = BVT_INFO(p);
     ASSERT(inf != NULL);
     ASSERT(p   != NULL);
 
-    if(weight > 0)
-        inf->mcu_advance = MCU_ADVANCE / weight;
-    else
-        inf->mcu_advance = MCU_ADVANCE;
+    inf->mcu_advance = MCU_ADVANCE;
     inf->domain = p;
     inf->warpback    = 0;
     /* Set some default values here. */
@@ -227,7 +224,7 @@ int bvt_init_idle_task(struct domain *p)
 
     if(bvt_alloc_task(p) < 0) return -1;
 
-    bvt_add_task(p, 0);
+    bvt_add_task(p);
 
     spin_lock_irqsave(&CPU_INFO(p->processor)->run_lock, flags);
     
index 3e027f8706e4469943c0d8839fb4b8cbc354dfe7..165c128753e09314e27a4e43243bc4be7aa778e3 100644 (file)
@@ -152,17 +152,14 @@ int fbvt_alloc_task(struct domain *p)
 /*
  * Add and remove a domain
  */
-void fbvt_add_task(struct domain *p, float weight
+void fbvt_add_task(struct domain *p) 
 {
     struct fbvt_dom_info *inf = FBVT_INFO(p);
 
     ASSERT(inf != NULL);
     ASSERT(p   != NULL);
 
-    if(weight > 0)
-        inf->mcu_advance = MCU_ADVANCE / weight;
-    else
-        inf->mcu_advance = MCU_ADVANCE;
+    inf->mcu_advance = MCU_ADVANCE;
     inf->domain = p;
     if ( p->domain == IDLE_DOMAIN_ID )
     {
@@ -190,7 +187,7 @@ int fbvt_init_idle_task(struct domain *p)
 
     if(fbvt_alloc_task(p) < 0) return -1;
 
-    fbvt_add_task(p, 0);
+    fbvt_add_task(p);
     spin_lock_irqsave(&CPU_INFO(p->processor)->run_lock, flags);
     set_bit(DF_RUNNING, &p->flags);
     if ( !__task_on_runqueue(p) )
index 28b0f73fa86563579e55962bf1d9adce7ae353c6..2ab5604fb51bdc04db25ca3688939d82f2f01e73 100644 (file)
@@ -101,9 +101,8 @@ static int rr_alloc_task(struct domain *d)
    return 0;
 }
 
-/* Setup the rr_dom_info 
-   The weight argument is ignored as RRobin does not use weights */
-static void rr_add_task(struct domain *p, float weight)
+/* Setup the rr_dom_info */
+static void rr_add_task(struct domain *p)
 {
     struct rrobin_dom_info *inf;
     RR_INFO(p)->domain = p;
@@ -122,7 +121,7 @@ static int rr_init_idle_task(struct domain *p)
 {
     unsigned long flags;
     if(rr_alloc_task(p) < 0) return -1;
-    rr_add_task(p, 0);
+    rr_add_task(p);
 
     spin_lock_irqsave(&run_locks[p->processor], flags);
     set_bit(DF_RUNNING, &p->flags);
index b37635324b9c22591d92756f3179c46cef1b43d7..d2778e09ed8516670c7b38a0e1c465eb9cf7a623 100644 (file)
@@ -123,7 +123,7 @@ struct domain *alloc_domain_struct(void)
 /*
  * Add and remove a domain
  */
-void sched_add_domain(struct domain *d, float weight
+void sched_add_domain(struct domain *d) 
 {
     /* Must be unpaused by control software to start execution. */
     set_bit(DF_CTRLPAUSE, &d->flags);
@@ -141,7 +141,7 @@ void sched_add_domain(struct domain *d, float weight)
         schedule_data[d->processor].idle = d;
     }
 
-    SCHED_OP(add_task, d, weight);
+    SCHED_OP(add_task, d);
 
     TRACE_2D(TRC_SCHED_DOM_ADD, d->domain, d);
 }
index cef857f5e5b7a589c0153710a5bd4be6d6bf17c6..8cea03fac2897d6cbfcfc1c1a9661cb3737d92a9 100644 (file)
@@ -55,7 +55,7 @@ typedef struct {
     MEMORY_PADDING;
     u8           name[MAX_DOMAIN_NAME]; /*  8 */
     u32          cpu;                 /* 24 */
-    float        weight;              /* 28 */
+    u32          __pad0;              /* 28 */
     /* IN/OUT parameters. */
     /* If 0, domain is allocated. If non-zero use it unless in use. */
     domid_t      domain;              /* 32 */
index 9088e61733552c03de13c18c8e08710cfa2d091b..15f992614ae80c1f18c8bc05e3e9da5c725f458e 100644 (file)
@@ -38,7 +38,7 @@ struct scheduler
     int          (*init_scheduler) ();
     int          (*init_idle_task) (struct domain *);
     int          (*alloc_task)     (struct domain *);
-    void         (*add_task)       (struct domain *, float weight);
+    void         (*add_task)       (struct domain *);
     void         (*free_task)      (struct domain *);
     void         (*rem_task)       (struct domain *);
     void         (*sleep)          (struct domain *);
index 3b8ad6c58b709ed1230bb681e7c3405bb4c07b7e..06b6faf6cc41fc5b3e560f05f3f50641b5afb550 100644 (file)
@@ -171,7 +171,7 @@ static inline int get_domain(struct domain *d)
 }
   
 extern struct domain *do_createdomain(
-    domid_t dom_id, unsigned int cpu, float weight);
+    domid_t dom_id, unsigned int cpu);
 extern int construct_dom0(struct domain *d, 
                           unsigned long alloc_start,
                           unsigned long alloc_end,
@@ -198,7 +198,7 @@ extern unsigned long wait_init_idle;
 #define set_current_state(_s) do { current->state = (_s); } while (0)
 void scheduler_init(void);
 void schedulers_start(void);
-void sched_add_domain(struct domain *d, float weight);
+void sched_add_domain(struct domain *d);
 void sched_rem_domain(struct domain *d);
 long sched_ctl(struct sched_ctl_cmd *);
 long sched_adjdom(struct sched_adjdom_cmd *);